<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!-- public quote -->
<%@include file="/jsp/comm_css_include.jsp"%>
<!-- jqgrid-->
<link href="${basePath}/css/plugins/jqgriddemo/css/ui.jqgrid-bootstrap.min.css" rel="stylesheet" />
<!doctype html>
<html>
<head>
	<style type="text/css">
	  *{
		 margin: 0px;
		 padding: 0px;
		 font-size: 12px;
	   }
	</style>
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeinright">
		<div class="iboxtitle">
			<span><i class="glyphicon glyphicon-map-marker"></i>&nsbp;</span>
			<a href="javascript:void(0)"></a>
		</div>
		<div class="ibox-content ibox-zxsearchqu ">
			<div class="row">
				<div class="col-xs-12 col-sm-12 col-md-12 col-lg-4">
					<div class="row">
						<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
							<label class="sr-only">客户名：</label> <input type="text" placeholder="客户名" id="customerName" name="customerName" class="form-control">
						</div>
						<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
							<label class="sr-only">业务员：</label> <input type="text" placeholder="业务员" id="salesmanName" name="salesmanName" class="form-control">
						</div>
					</div>
				</div>
				<div class="col-xs-12 col-sm-12 col-md-12 col-lg-4">
					<div class="row">
						<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
							<input id="submitTimeStart" name="submitTimeStart" placeholder="开始时间" class="laydate-icon form-control">
						</div>
						<label class="hxleft">至</label>
						<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
							<input id="submitTimeEnd" name="submitTimeEnd" placeholder="结束时间" class="laydate-icon form-control">
						</div>
					</div>
				</div>
				<div class="col-xs-12 col-sm-12 col-md-12 col-lg-4">
					<button class="btn dpbtn_blue_null" type="button" onclick="query(0,0);">当日</button>
					<button class="btn dpbtn_blue_null" type="button" onclick="query(-1,-1);">昨日</button>
					<button class="btn dpbtn_blue_null" type="button" onclick="query(-6,0);">近7日</button>
					<button class="zhixcx" type="button" onclick="query();">执行查询</button>
				</div>
			</div>
		</div>
		<div class="ibox-content">
			<span class="warning-label"></span>
			<div class="jqGrid_wrapper">
				<table id="table_list_1"></table>
				<div id="pager_list_1"></div>
			</div>
		</div>
		<!-- 列隐藏 -->
		<div class="ibox-content" id="hideName" name="hideName" style="display: none;">
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox" checked="checked" name="chName" value="dealer" onclick="chNameOnclick();"><i></i> 经销商
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox" checked="checked" name="chName" value="dealerLevelDisplay" onclick="chNameOnclick();"><i></i> 经销商等级
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox" checked="checked" name="chName" value="cusName" onclick="chNameOnclick();"><i></i> 客户姓名
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox" checked="checked" name="chName" value="loanAmount" onclick="chNameOnclick();"><i></i> 实际贷款额
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox" checked="checked" name="chName" value="departmentName" onclick="chNameOnclick();"><i></i> 部门
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox" checked="checked" name="chName" value="salersmanName" onclick="chNameOnclick();"><i></i> 业务员
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox" checked="checked" name="chName" value="statusList" onclick="chNameOnclick();"><i></i> 审核状态
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox" checked="checked" name="chName" value="source" onclick="chNameOnclick();"><i></i> 来源
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox" checked="checked" name="chName" value="operatorName" onclick="chNameOnclick();"><i></i> 锁定人
                </label>
            </div>
		</div>
		<!-- 排序 -->
		<div class="ibox-content" id="hideDescName" name="hideDescName" style="display: none;">
			<div class="m-l m-r-xs" style="color: #FC1515;">
				默认按业务提交时间反序
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="radio" name="radioName" value="asc" onclick="chNameDescOnclick();"><i></i> 正序
                </label>
                <label class="i-checks">
                   <input type="radio" name="radioName" checked="checked" value="desc" onclick="chNameDescOnclick();"><i></i> 反序
                </label>
            </div>
            <hr/>
			<div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox" checked="checked" name="chDescName" value="busi_confirm_time" onclick="chNameDescOnclick();"><i></i> 业务提交时间
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox"  name="chDescName" value="channel_type_name" onclick="chNameDescOnclick();"><i></i> 订单类型
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox"  name="chDescName" value="dealer" onclick="chNameDescOnclick();"><i></i> 经销商
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox"  name="chDescName" value="cus_name" onclick="chNameDescOnclick();"><i></i> 客户姓名
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox" name="chDescName" value="loan_amount" onclick="chNameDescOnclick();"><i></i> 实际贷款额
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox" name="chDescName" value="department_name" onclick="chNameDescOnclick();"><i></i> 部门
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox" name="chDescName" value="salersman_name" onclick="chNameDescOnclick();"><i></i> 业务员
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox"  name="chDescName" value="status_list" onclick="chNameDescOnclick();"><i></i> 审核状态
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox"  name="chDescName" value="source" onclick="chNameDescOnclick();"><i></i> 来源
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox"  name="chDescName" value="created" onclick="chNameDescOnclick();"><i></i> 创建时间
                </label>
            </div>
            <div class="checkbox m-l m-r-xs">
                <label class="i-checks">
                   <input type="checkbox"  name="chDescName" value="modified" onclick="chNameDescOnclick();"><i></i> 修改时间
                </label>
            </div>
            <div class="checkbox m-l m-r-xs" style="float: right;">
            	<a class="dpbtn_blue_height" onclick="paixu();">确定</a>
            </div>
		</div>
		<!-- 统计 -->
		<div class="ibox-content" id="line-chart" name="line-chart" style="display: none;">
			<div class="m-l m-r-xs" style="color: #FC1515;">
				注意：只统计当前模块的数据，订单类型、实际贷款额
            </div>
			<div class="ibox-content">
				<div class="echarts" id="echarts-bar-chart" style="height: 200px;"></div>
			</div>
			<div class="ibox-content">
				<div class="echarts" id="echarts-pie-chart" style="height: 200px;"></div>
			</div>
		</div>
	</div>

	<!-- public quote -->
	<%@include file="/jsp/comm_js_include.jsp"%>
	<!-- jqGrid -->
	<script type="text/javascript" charset="utf-8" src="${basePath}/js/plugins/jqgriddemo/js/jquery.jqGrid.min.js"></script>
	<script type="text/javascript" charset="utf-8" src="${basePath}/js/plugins/jqgriddemo/js/grid.locale-cn.min.js"></script>
	<!-- layerDate plugin javascript -->
	<script src="${basePath}/js/plugins/layer/laydate/laydate.js"></script>
	<!-- echarts -->
	<%@include file="/js/common-dpqc/dpqc-echarts/comm_echarts_include.jsp"%>


	<!--
    	作者：zhangpp
    	时间：2017-04-06
    	描述：js
    -->
	<script type="text/javascript">
	
	    jQuery(function($){
	    	
		    laydate({
		        elem: '#submitTimeStart', 
		        event: 'focus' 
		    });
	    	
		    laydate({
		        elem: '#submitTimeEnd', 
		        event: 'focus' 
		    });
	    	
	    	getData();
	    });
	    
	    var getData = function()
	    {
	      var winWidth = $('div.ibox-content').width();
	      var win = winWidth / 11 - 15;	
	      var busiConfirmTimeWidth = win;
	      if(win < 180)
	      {
	    	  busiConfirmTimeWidth = 180;
	      }
	      var modeId = $.getUrlData('modeId');
	      var colNames = [ 'replaceId','busiId','customerName','customerNo','operatorId','业务提交时间', '订单类型','经销商','经销商等级','客户姓名','实际贷款额', '部门','业务员','审核状态', '来源',  '锁定人'];
	      var colModel = [ 
  	                    {name: 'replaceId',width: win,hidden:true},
	                    {name: 'busiId',width: win,hidden:true},
	                    {name: 'customerName',width: win,hidden:true},
	                    {name: 'customerNo',width: win,hidden:true},
	                    {name: 'operatorId',width: win,hidden:true},
	                    {name: 'busiConfirmTime',width: busiConfirmTimeWidth,align: "center",sortable: false},
	                    {name: 'channelTypeName',width: 200,align: "center",sortable: false},
	                    {name: 'dealer',width: win,align: "center",sortable: false},
	                    {name: 'dealerLevelDisplay',width: win,align: "center",sortable: false},
	                    {name: 'cusName',width: win,align: "center",sortable: false},
	                    {name: 'loanAmount',width: win,align: "center",sortable: false,
	                    	formatter:function(cellvalue,options,rowObject)
	                    	{
		                       		 return showNumber(cellvalue);
		                    }	
	                    },
	                    {name: 'departmentName',width: win,align: "center",sortable: false},
	                    {name: 'salersmanName',width: win,align: "center",sortable: false},
	                    {name: 'statusList',width: win,align: "center",sortable: false},
	                    {name: 'source',width: win,align: "center",sortable: false},
	                    {name: 'operatorName',width: win,align: "center",sortable: false}
	      ];
	      
	      //财务审核二
	      if(modeId == "M_dedksp")
	      {
	    	  colNames = [ 'replaceId','busiId','customerName','customerNo','operatorId','业务提交时间', '订单类型','经销商','经销商等级','客户姓名','实际贷款额', '部门','业务员','审核状态', '来源','银行','锁定人'];
		      colModel = [ 
	  	                    {name: 'replaceId',width: win,hidden:true},
		                    {name: 'busiId',width: win,hidden:true},
		                    {name: 'customerName',width: win,hidden:true},
		                    {name: 'customerNo',width: win,hidden:true},
		                    {name: 'operatorId',width: win,hidden:true},
		                    {name: 'busiConfirmTime',width: busiConfirmTimeWidth,align: "center",sortable: false},
		                    {name: 'channelTypeName',width: 200,align: "center",sortable: false},
		                    {name: 'dealer',width: win,align: "center",sortable: false},
		                    {name: 'dealerLevelDisplay',width: win,align: "center",sortable: false},
		                    {name: 'cusName',width: win,align: "center",sortable: false},
		                    {name: 'loanAmount',width: win,align: "center",sortable: false,
		                    	formatter:function(cellvalue,options,rowObject)
		                    	{
			                       		 return showNumber(cellvalue);
			                    }	
		                    },
		                    {name: 'departmentName',width: win,align: "center",sortable: false},
		                    {name: 'salersmanName',width: win,align: "center",sortable: false},
		                    {name: 'statusList',width: win,align: "center",sortable: false},
		                    {name: 'source',width: win,align: "center",sortable: false},
		                    {name: 'bankname',width: win,align: "center",sortable: false},
		                    {name: 'operatorName',width: win,align: "center",sortable: false,hidden:true}
		       ];
	      }
	      
	      //鑫合汇资审一审审核
	      if(modeId == "M_xhhzsys")
	      {
	    	  var content = '';
	    	  content += '<div class="checkbox m-l m-r-xs">';
	    	  content += '	<label class="i-checks">';
	    	  content += '		<input type="checkbox" checked="checked" name="chName" value="fileStatus" onclick="chNameOnclick();"><i></i> 附件状态';
	    	  content += '	</label>';
	    	  content += '</div>';
	    	  $('#hideName').append(content);
	    	  
		      var win = winWidth / 12 - 15;	
		      var busiConfirmTimeWidth = win;
		      if(win < 180)
		      {
		    	  busiConfirmTimeWidth = 180;
		      }
	    	  colNames = [ 'replaceId','busiId','customerName','customerNo','operatorId','业务提交时间','订单类型','附件状态','经销商','经销商等级','客户姓名','实际贷款额', '部门','业务员','审核状态', '来源',  '锁定人'];
		      colModel = [ 
	  	                    {name: 'replaceId',width: win,hidden:true},
		                    {name: 'busiId',width: win,hidden:true},
		                    {name: 'customerName',width: win,hidden:true},
		                    {name: 'customerNo',width: win,hidden:true},
		                    {name: 'operatorId',width: win,hidden:true},
		                    {name: 'busiConfirmTime',width: busiConfirmTimeWidth,align: "center",sortable: false},
		                    {name: 'channelTypeName',width: 200,align: "center",sortable: false},
		                    {name: 'fileStatus',width: win,align: "center",sortable: false,
		                    	formatter:function(cellvalue,options,rowObject)
		                    	{
			                       		 if(cellvalue == "附件已上传")
			                       		 {
			                       			return '<span class="dp-grid-green">'+cellvalue+'</span>';
			                       		 }
			                       		return '<span class="dp-grid-red">'+cellvalue+'</span>';
			                    }		
		                    },
		                    {name: 'dealer',width: win,align: "center",sortable: false},
		                    {name: 'dealerLevelDisplay',width: win,align: "center",sortable: false},
		                    {name: 'cusName',width: win,align: "center",sortable: false},
		                    {name: 'loanAmount',width: win,align: "center",sortable: false,
		                    	formatter:function(cellvalue,options,rowObject)
		                    	{
			                       		 return showNumber(cellvalue);
			                    }	
		                    },
		                    {name: 'departmentName',width: win,align: "center",sortable: false},
		                    {name: 'salersmanName',width: win,align: "center",sortable: false},
		                    {name: 'statusList',width: win,align: "center",sortable: false},
		                    {name: 'source',width: win,align: "center",sortable: false},
		                    {name: 'operatorName',width: win,align: "center",sortable: false}
		      ];
	      }
	      
	      //资审一审
	      if(modeId == "M_zsys")
	      {		
	    	  var content = '';
	    	  content += '<div class="checkbox m-l m-r-xs">';
	    	  content += '	<label class="i-checks">';
	    	  content += '		<input type="checkbox" checked="checked" name="chName" value="uname" onclick="chNameOnclick();"><i></i> 预审保存人';
	    	  content += '	</label>';
	    	  content += '</div>';
	    	  $('#hideName').append(content);
	    	  
	    	  var win = winWidth / 12 - 15;	
	    	  colNames = [ 'replaceId','busiId','customerName','customerNo','operatorId','业务提交时间', '订单类型','经销商','经销商等级','客户姓名','实际贷款额', '部门','业务员','审核状态', '来源',  '锁定人','预审保存人'];
	    	  colModel = [ 
	  	                    {name: 'replaceId',width: win,hidden:true},
		                    {name: 'busiId',width: win,hidden:true},
		                    {name: 'customerName',width: win,hidden:true},
		                    {name: 'customerNo',width: win,hidden:true},
		                    {name: 'operatorId',width: win,hidden:true},
		                    {name: 'busiConfirmTime',width: busiConfirmTimeWidth,align: "center",sortable: false},
		                    {name: 'channelTypeName',width: 200,align: "center",sortable: false},
		                    {name: 'dealer',width: win,align: "center",sortable: false},
		                    {name: 'dealerLevelDisplay',width: win,align: "center",sortable: false},
		                    {name: 'cusName',width: win,align: "center",sortable: false},
		                    {name: 'loanAmount',width: win,align: "center",sortable: false,
		                    	formatter:function(cellvalue,options,rowObject)
		                    	{
			                       		 return showNumber(cellvalue);
			                    }	
		                    },
		                    {name: 'departmentName',width: win,align: "center",sortable: false},
		                    {name: 'salersmanName',width: win,align: "center",sortable: false},
		                    {name: 'statusList',width: win,align: "center",sortable: false},
		                    {name: 'source',width: win,align: "center",sortable: false},
		                    {name: 'operatorName',width: win,align: "center",sortable: false},
		                    {name: 'uname',width: win,align: "center",sortable: false}
		      ];
	      }
	      
	      var winWidth = $('div.ibox-content').width();
	      var winHeight = document.body.offsetHeight - 360;
  	 	  $.jgrid.defaults.styleUI = 'Bootstrap';
  	 	  if(modeId == "M_lstdsh")
  	 	  {
				$(".warning-label").html('<span class="red-dp-circle"></span>请在完成财务垫款后再做审核处理');
		  }
  	 	  else
  	 	  {
				$(".warning-label").html('');
		  } 
		  jQuery("#table_list_1").jqGrid
		  ({
			  url:'${basePath}/FengKongShenHeController/diepuFengKongShenHeV001List',
			  datatype : "json",
		      postData:{"modeId":modeId,"statusList":1},
              colNames : colNames,
    	      colModel : colModel,
              mtype : "post",
              height: winHeight,
              width:winWidth,  
              shrinkToFit:false,
              autoScroll: false,
              rowNum: 15,
              rowList: [15, 30, 45],
              viewrecords: true,
              pager: "#pager_list_1",
              hidegrid: false,
              multiselect : false,
              altRows:true,
              altclass:'someClass',
              footerrow:true,
              ondblClickRow:function(rowId)
              {
            	  var row = $(this).jqGrid("getRowData",rowId);
            	  
            	  $.dpAjax({
            		show:false,
  		 			url:'${basePath}/FengKongShenHeController/getLoanEditLock',
  		 			data:{
  		 				"busiId":row.busiId,
  		 				"modeId":modeId
  		 			},
  		 			success: function(datas)
  		 			{
  		 				  if(datas.flag == "100100")
  		 				  {
  		 					  //传递的参数  1：审批主键   2：业务主键 3：模块编码  4：客户姓名 5:客户身份证
  		 	            	  if(!row.operatorId || null == row.operatorId || row.operatorId == "" || row.operatorId == "undefined")
  		 	            	  {
  		 	            		  layer.msg('正在进入，请稍后...',{icon: 16,shade: 0.01});
  		 	            		  window.location.href="${basePath}/FengKongShenHeView/diepuFengKongShenHeV001View?replaceId="+row.replaceId+"&busiId="+row.busiId+"&modeId="+modeId+"&customerName="+row.customerName+"&customerNo="+row.customerNo;  
  		 	            	  }
  		 	            	  else if(row.operatorId != '${current_user_key.id}')
  		 	            	  {
  		 	            		  layer.confirm('已经被锁定，是否进入？', {
  		 	            			  btn: ['确定','取消'] //按钮
  		 	            		  },function(){
  		 	            			  layer.msg('正在进入，请稍后...',{icon: 16,shade: 0.01});
  		 	            			  layer.closeAll();
  		 	            			  window.location.href="${basePath}/FengKongShenHeView/diepuFengKongShenHeV001View?replaceId="+row.replaceId+"&busiId="+row.busiId+"&modeId="+modeId+"&customerName="+row.customerName+"&customerNo="+row.customerNo; 
  		 	            		  },function(){
  		 	            			  layer.msg('您已关闭，请确认！', {icon: 6});
  		 	            		  });
  		 	            	  }
  		 	            	  else
  		 	            	  {
  		 	            		  layer.msg('正在进入，请稍后...',{icon: 16,shade: 0.01});
  		 	            		  window.location.href="${basePath}/FengKongShenHeView/diepuFengKongShenHeV001View?replaceId="+row.replaceId+"&busiId="+row.busiId+"&modeId="+modeId+"&customerName="+row.customerName+"&customerNo="+row.customerNo;   
  		 	            	  }
  		 					  return;
  		 				  }
  		 				  layer.msg(datas.message, {icon: 5});
  		 		     }
  		 		  });
              },
              gridComplete:function(row)
              {
            	  var ids = $(this).getDataIDs();
            	  for(var i=0;i<ids.length;i++)
            	  {
            		  var row = $(this).getRowData(ids[i]);
            		  if(!row.operatorId || null == row.operatorId || row.operatorId == "" || row.operatorId == "undefined")
              		  {
            			  $('#'+ids[i]).find("td").addClass("dp-grid-deepgrey");
              		  }
            		  else if(row.operatorId == '${current_user_key.id}')
            		  {
            			  $('#'+ids[i]).find("td").addClass("dp-grid-deepgreen");
            		  }
            		  else
            		  {
            			  $('#'+ids[i]).find("td").addClass("dp-grid-deepred");
            		  }
            	  }
            	  
            	  if(ids.length > 0)
            	  {
            		  var loanAmountSum = jQuery(this).getCol('loanAmount', false, 'sum');
            		  var datas = 
            		  {
            				  'channelTypeName':"<font color='#DA242A'>实际贷款额合计</font>  "+loanAmountSum+"",
	            			  'busiConfirmTime':'<a class="dpbtn_blue_height"  onclick="shenxuan();" style="width:200px;">显示</a>  <a class="dpbtn_blue_height" onclick="shenxuanDesc();">排序</a>  <a class="dpbtn_blue_height" onclick="tongji();">统计</a>'  
            		  };
            		  $(this).footerData("set",datas);
            	  }
            	  
              },
              loadComplete:function(datas){
            	  if (datas.flag == "100100") {
                      layer.msg("查询成功!", {icon: 6, time: 1000});
                      return;
                  }
            	  if(datas.flag == '100802') {
    				  top.location.href = thisLoginUrl;
    				  return;
    			  }
            	  layer.msg(datas.message, {icon: 2});
              },
              jsonReader : {
            	  root:"result.rows",
            	  page: "result.page",
            	  total: "result.total",
            	  records: "result.records",
            	  repeatitems: false,
            	  id: "replaceId" 
              }
	      });
	    }	    
	    
	    //查询
	    var query = function(start, end)
	    {
	    	var postData = $("#table_list_1").jqGrid("getGridParam", "postData");
	    	var data = {};
	    	data.customerName = document.getElementById('customerName').value || '';
	    	data.salesmanName = document.getElementById('salesmanName').value || '';
	    	if(start != null && typeof start != 'undefined')
	    	{
	    		document.getElementById('submitTimeStart').value = laydate.now(start);
	    		document.getElementById('submitTimeEnd').value = laydate.now(end);
	    	}
	    	data.submitTimeStart = document.getElementById('submitTimeStart').value.trim();
	    	data.submitTimeEnd = document.getElementById('submitTimeEnd').value.trim();
	    	$.extend(postData, data);
	    	refresh();
	    }
	    
	    window.onresize = function()
	    {
	    	$("#table_list_1").setGridWidth($(window).width()-80);
	    }

	    var refresh = function()
	    {
	    	$("#table_list_1").jqGrid("setGridParam", { search: true }).trigger("reloadGrid", [{ page: 1}]);
	    }
	    
	    var shenxuan = function()
	    {
	    	var hideName = $('#hideName');
	    	layer.open({
	    	  type: 1,
	    	  area: ['220px'],
	    	  skin: 'layui-layer-lan', 
	    	  shadeClose: false, 
	    	  content: hideName
	    	});
	    }
	    
	    var chNameOnclick = function()
	    {
	    	var objs = document.getElementsByName("chName");
	    	if(objs && objs.length > 0)
	    	{
	    		for(var i=0;i<objs.length;i++)
	    		{
	    			if(objs[i].checked == false)
	    			{
	    				var value = objs[i].value;
	    				jQuery("#table_list_1").jqGrid('hideCol', [value]);
	    			}
	    			else
	    			{
	    				var value = objs[i].value;
	    				jQuery("#table_list_1").jqGrid('showCol', [value]);
	    			}
	    		}
	    	}
	    }
	    
	    var shenxuanDesc = function()
	    {
	    	var hideDescName = $('#hideDescName');
	    	layer.open({
	    	  type: 1,
	    	  area: ['220px'],
	    	  skin: 'layui-layer-lan', 
	    	  shadeClose: false, 
	    	  content: hideDescName
	    	});
	    }
	    
	    var chNameDescOnclick = function()
	    {
	    	
	    }
	    
	    var paixu = function()
	    {
	    	var sqlXmls = "";
	    	var data = {};
	    	var objs = document.getElementsByName("chDescName");
	    	if(objs && objs.length > 0)
	    	{
	    		for(var i=0;i<objs.length;i++)
	    		{
	    			if(objs[i].checked)
	    			{
	    				sqlXmls += objs[i].value + ",";
	    			}
	    		}
	    		if(sqlXmls != "")
	    		{
	    			sqlXmls = sqlXmls.substring(0,sqlXmls.length - 1);
	    			
	    			var radio = document.getElementsByName("radioName");
		    		if(radio && radio.length > 0)
		    		{
		    			for(var i=0;i<radio.length;i++)
		    			{
		    				if(radio[i].checked)
			    			{
			    				sqlXmls += " " +radio[i].value;
			    			}
		    			}
		    		}
	    		}
	    	}
	    	var postData = $("#table_list_1").jqGrid("getGridParam", "postData");
	    	$.extend(postData, {"orderSql":sqlXmls});
	    	refresh();
	    	layer.closeAll();
	    }
	    
	    var tongji = function()
	    {
	    	var modeId = $.getUrlData('modeId');
	    	$.dpAjax({
	 			url:'${basePath}/FengKongShenHeController/getStatistics',
	 			data:{"modeId":modeId,modeIdType:"fksh"},
	 			success: function(datas)
	 			{
	 				  if(datas.flag == "100100")
	 				  {
	 					  var resultFksh = datas.resultFksh;
	 					  var resultChannelName = datas.resultChannelName;
	 					  if(resultFksh && resultChannelName)
	 					  {
	 						    var winWidth = $(window).width();
	 				    	    var winHeight = $(window).height();
	 				    	    var line_chart = $('#line-chart');
		 				    	layer.open({
		 				    	  type: 1,
		 				    	  area: [(winWidth/2)+'px'],
		 				    	  skin: 'layui-layer-lan', 
		 				    	  shadeClose: false, 
		 				    	  content: line_chart
		 				    	});
		 				    	
		 				    	var dataKey = [];
		 				    	var data = [];
		 				    	for(var i=0;i<resultFksh.length;i++)
		 				    	{
		 				    		dataKey.push(resultFksh[i].cus_name);
		 				    		data.push(resultFksh[i].loan_amount);
		 				    	}
		 				    	
		 				    	
		 				    	var dataValue = [
		   	    	                {
		   	    	                      name:'实际贷款额',
		   	    	                      type:'bar',
		   	    	                      data:data,
		   	    	                      markPoint : {
		   	    	                          data : [
		   	    	                              {type : 'max', name: '最大值'},
		   	    	                              {type : 'min', name: '最小值'}
		   	    	                          ]
		   	    	                      },
		   	    	                      markLine : {
		   	    	                          data : [
		   	    	                              {type : 'average', name: '平均值'}
		   	    	                          ]
		   	    	                      }
		   	    	                }
	   	    	              ];
		 				    	
		 				      
	 				    	  $.fn.barChart({
		 				    		"id":"echarts-bar-chart", 
		 							"text":"", 
		 							"categories":['实际贷款额'], 
		 							"formatter":"", 
		 							"dataKey":dataKey,
		 							"dataValue":dataValue 
	 				    	  });
	 				    	  
	 				    	  var categories = [];
	 				    	  var data = [];
	 				    	  for(var i=0;i<resultChannelName.length;i++)
	 				    	  {
	 				    		 categories.push(resultChannelName[i].channel_type_name);
	 				    		 var objs = {};
	 				    		 objs.value = resultChannelName[i].channel_type
	 				    		 objs.name = resultChannelName[i].channel_type_name;
	 				    		 data.push(objs);
	 				    	  }
	 				    	  
	 				    	  var dataValue =  [
	  		          	            {
	  		        	                name:'订单类型',
	  		        	                type:'pie',
	  		        	                radius : '55%',
	  		        	                center: ['50%', '60%'],
	  		        	                data:data
	  		        	            }
	  	        	          ];
	 				    	  
	 				    	  $.fn.pieChart({
	 				    		 "id":"echarts-pie-chart",   
	 							 "text":"",		  
	 							 "subtext":"订单类型",   		
	 							 "formatter":"{a} <br/>{b} : {c} ({d}%)",  
	 							 "categories":categories, 
	 							 "dataValue":dataValue,  
	 							 "legendx":"left", 
	 				    	 });
	 					  }
	 					  return;
	 				  }
	 				  layer.msg(datas.message, {icon: 5});
	 		     }
		    });
	    }
    </script>
</body>
</html>
